<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Repositories\Acl\StaffRepository as Staff;
/**
 * Class LoginController
 * @package App\Http\Backend\Controllers
 */
class LoginController extends Controller
{
    /**
     * @var Administrator
     */
    protected $staff;
    
    public function __construct(Staff $staff)
    {
        parent::__construct();
        
        $this->staff = $staff;
    }


    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function index()
    {
        $rNum = rand(1, 11);
        
        return view($this->view, compact('rNum'));
    }

    /**
     * 登录
     *
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse|mixed
     */
    public function login(Request $request)
    {        
        return $this->staff->login($request);
    }

}
